package io.ly.filte.controller;

import jakarta.servlet.http.HttpServletRequest;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import java.io.IOException;

/**
 * @Author LY
 * @create 2023/12/29 18:14
 * @Description FilterController
 */
@RestController
@Slf4j
public class FilterController {

    @PostMapping("/getStr")
    public String getStr(@RequestBody Object obj) {
        log.info("FilterController->getStr,接收参数,obj = " + obj.toString());
        return "success";
    }

    @GetMapping("/getStr2")
    public String getStr2(String str, HttpServletRequest request) throws IOException {
        System.out.println(request.getReader());
        log.info("FilterController->getStr2,接收参数,str = " + str);
        return str;
    }

    @PostMapping("/getStr3")
    public String getStr3(String str, HttpServletRequest request) throws IOException {
        request.getInputStream();
        log.info("FilterController->getStr2,接收参数,str = " + str);
        return str;
    }

}
